
	function adminFunBind(){	//管理员功能绑定
		$("#publishNotice").unbind().click(function(){	//发布公告
			$("h1").text("发布公告");
			$('#publishNoticeFun').show().siblings().hide();
			$('#publishNoticeFun #content').val('');
			$('#publishNoticeFun #publish_date').val('');
			$("#publishNoticeFun #submitBtn").unbind();
			$("#publishNoticeFun #submitBtn").click(function(){
				doPublishNotice();
			});
			$("#publishNoticeFun #prevBtn").unbind();
			$("#publishNoticeFun #prevBtn").click(function(){
				showMoreAdminFun();
			});
		})
		
		$("#deletePost").unbind().click(function(){	//删除帖子
			$("h1").text("删除帖子");
			$('#deletePostFun').show().siblings().hide();
			$('#deletePostFun #post_id').val('');
			$("#deletePostFun #submitBtn").unbind();
			$("#deletePostFun #submitBtn").click(function(){
				doDeletePost();
			});
			$("#deletePostFun #prevBtn").unbind();
			$("#deletePostFun #prevBtn").click(function(){
				showMoreAdminFun();
			});
		})
		
		$("#reviewPost").unbind().click(function(){	//审核帖子
			getPartPost();		//获取待审核的帖子
			$('#AllPost').show().siblings().hide();
		})
		
	}
	
	function getPartPost(){		//获取待审核的帖子
		request("GET", "/getPost/part", {}, getPartPostSuccess, getPartPostError, true);
		function getPartPostSuccess(responseData){
			if(responseData.code=="2300")
			{
				var posts=responseData.data;
				$('#AllPost').empty();
				var post_id={'S':'寻求帮助','P':'提供帮助'};

				for(var i=0;i<posts.length;i++){
					var span_post_id=$('<span>').text(post_id[posts[i].post_id[0]]).attr('id','post_type');
					var span_theme=$('<span>').text(posts[i].theme).attr('id','theme');
					var span_publish_date=$('<span>').text(posts[i].publish_date).attr('id','publish_date');
					var span_verify=$('<span>').text('待审核').attr('id','verify');
					var div=$('<div>').append(span_post_id,span_theme,span_verify,span_publish_date).attr('id',posts[i].post_id).addClass('onePost');
					$('#AllPost').append(div);
					div.unbind().click(function(){
						showPost($(this).attr('id'),2);		//显示帖子的详细信息
					})
				}
				$('#AllPost').show().siblings().hide();
				$("h1").text("待审核帖子");
			}
			else
				alert(responseData.description);
		}
		function getPartPostError(){}
	}
	function doVerifyPost(post_id,check_result){		//审核帖子
		request("POST", "doVerifyPost", {'post_id':post_id,'check_result':check_result}, doVerifyPostSuccess, doVerifyPostError, true);
		function doVerifyPostSuccess(responseData){
			if(responseData.code=="2400"){				
				setTimeout(function(){$("#reviewPost").click();}, 500 );	//显示所有待审核的帖子
			}			
			else
				alert(responseData.description);
		}
		function doVerifyPostError(){}
	}
	
	
	function doPublishNotice(){	//访问API，发布公告
		var publish_date=$('#publishNoticeFun #publish_date').val();
		var content=$('#publishNoticeFun #content').val();
		var notice={'publish_date':publish_date,'content':content};
		request("POST", "/doPublishNotice", notice, doPublishNoticeSuccess, doPublishNoticeError, true);
		function doPublishNoticeSuccess(responseData){
			if(responseData.code=="2100")
			{
				alert(responseData.description);
				allNotice();				//获取公告
				showMoreNotice();		//显示公告
			}
			else
				alert(responseData.description);
		}
		function doPublishNoticeError(){}
	}
	
	function doDeletePost(){	//访问API，删除帖子
		var post_id=$('#deletePostFun #post_id').val();
		request("POST", "/doDeletePost", {'post_id':post_id}, doDeletePostSuccess, doDeletePostError, true);
		function doDeletePostSuccess(responseData){
			if(responseData.code=="2200")
			{
				alert(responseData.description);
			}
			else
				alert(responseData.description);
		}
		function doDeletePostError(){}
	}
	
